﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WuDada.Core.Post;
using WuDada.Core.Post.Service;
using WuDada.Core.Post.Domain;
using System.Text;

public partial class Main : System.Web.UI.MasterPage
{
    private PostFactory m_PostFactory;
    private IPostService m_PostService;

    protected void Page_Load(object sender, EventArgs e)
    {
        m_PostFactory = new PostFactory();
        m_PostService = m_PostFactory.GetPostService();

        if (!IsPostBack)
        {
            FillService();

            //ltlCount.Text = Application["count"].ToString();
        }
    }

    private void FillService()
    {
        Dictionary<string, string> conditions = new Dictionary<string, string>();
        IList<NodeVO> list = m_PostService.GetNodeListByParentId(7);
        StringBuilder sb = new StringBuilder();

        if (list != null && list.Count > 0)
        {
            foreach (NodeVO nodeVO in list)
            {
                sb.AppendFormat("<li class='Sbtn-stable-li'><a href='service.aspx?node={0}' class='whitebtn'>{1}</a></li>", nodeVO.NodeId, nodeVO.Name);
            }

            ltlService.Text = sb.ToString();
        }
    }
}
